from django.template import Library

register = Library()


@register.filter
def add_class(value, class_str):
    return value.as_widget(attrs={'class': class_str})
